package router

import (
	"github.com/gin-gonic/gin"
	"myblog/controller"
)

func Router() {
	e := gin.Default()
	e.Static("/assets", "./assets")
	e.LoadHTMLGlob("./templates/*")

	e.GET("/index", controller.Index)
	e.GET("/login", controller.GoLogin)
	e.POST("/login", controller.AddUser)
	e.POST("/index", controller.FindUser)

	e.GET("/add_blog", controller.GoBlog)
	e.POST("/add_blog", controller.AddBlog)

	e.GET("/list", controller.Showblog)
	e.GET("/details", controller.Details)

	e.Run()
}
